package core;

import java.util.ArrayList;
import java.util.HashMap;

import exception.ColumnException;
import exception.ColumnExistsException;
import exception.ConstraintException;
import exception.DataException;
import exception.DatabaseExistsException;
import exception.NoSuchColumnFoundException;
import exception.NoSuchDatabaseFoundException;
import exception.NoSuchTableFoundException;
import exception.TableExistsException;
import exception.UnknownActionException;

public interface IRDBMS {
	public void init();

	public void createDatabase(String dbName) throws DatabaseExistsException;
	public void createTable(String dbName, String tableName, ArrayList<String> columns, ArrayList<String> constraints) throws TableExistsException, NoSuchDatabaseFoundException, NoSuchTableFoundException, NoSuchColumnFoundException, ColumnExistsException, ConstraintException, NumberFormatException, ColumnException;
	public void alterTable(String dbName, String tableName, String action, String columnName, String type) throws NoSuchDatabaseFoundException, NoSuchTableFoundException, NoSuchColumnFoundException, ColumnExistsException, UnknownActionException, ConstraintException, NumberFormatException, ColumnException;

	public void dropTable(String dbName, String tableName) throws NoSuchDatabaseFoundException, NoSuchTableFoundException, ConstraintException;

	public void insert(String dbName, String tableName, HashMap<String, String> values) throws NoSuchDatabaseFoundException, NoSuchTableFoundException, NoSuchColumnFoundException, DataException, ConstraintException;
	public HashMap<String, String> select(String dbName, String tableName, String columns, String[] conditions) throws NoSuchDatabaseFoundException, NoSuchTableFoundException, NoSuchColumnFoundException, DataException;
	public void delete(String dbName, String tableName, String[] conditions) throws NoSuchDatabaseFoundException, NoSuchTableFoundException, NoSuchColumnFoundException, DataException;
	public void update(String dbName, String tableName, String[] update, String[] conditions) throws NoSuchDatabaseFoundException, NoSuchTableFoundException, NoSuchColumnFoundException, DataException;
}
